using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
public partial class asp_pages_Master : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ProductCategoryDAO daoProCate = new ProductCategoryDAO();
            cmbType.Items.Clear();
            cmbType.Items.Add(new ListItem("Pet","0"));
            cmbType.Items.Add(new ListItem("Product", "1"));
            cmbPrice.Items.Clear();
            cmbPrice.Items.Add(new ListItem("$0 - $50", "0%50"));
            cmbPrice.Items.Add(new ListItem("$0 - $50", "0%50"));
            cmbPrice.Items.Add(new ListItem("$50 - $150", "50%150"));
            cmbPrice.Items.Add(new ListItem("$150 - $300", "100%300"));
            cmbPrice.Items.Add(new ListItem("$300 - $500", "300%500"));
            cmbPrice.Items.Add(new ListItem("$300 - $500", "300%500"));
            cmbPrice.Items.Add(new ListItem("> $500", "500%10000000"));
        }
        if (Session["user"]!=null)
        {
            lblUserID.Text = Session["user"].ToString();
        }
        else lblUserID.Text = "Guest";
        if (Application["online"] != null) lblOnlineNum.Text = Application["online"].ToString();
    }
    public int GetCateID(string productCategoryName, List<ProductCategory> cateList)
    {
        foreach (ProductCategory cate in cateList)
        {
            if(cate.Name.Equals(productCategoryName,StringComparison.CurrentCultureIgnoreCase))return cate.ID;
        }
        return -1;
    }
}
